#include "glasses.hpp"

void detectAndDrawGlasses(cv::Mat &img, const cv::Mat &faceROI, const cv::Rect &face, cv::CascadeClassifier &eyeglasses_cascade)
{
    std::vector<cv::Rect> glasses;
    eyeglasses_cascade.detectMultiScale(faceROI, glasses, 1.1, 2, 0 | cv::CASCADE_SCALE_IMAGE, cv::Size(30, 30));
    for (const auto &glass : glasses)
    {
        cv::rectangle(img, cv::Point(face.x + glass.x, face.y + glass.y),
                      cv::Point(face.x + glass.x + glass.width, face.y + glass.y + glass.height),
                      cv::Scalar(255, 255, 255), 2);
    }
}
